<template>
      <el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
                <el-form-item label="编码" prop="code">
                    <el-input v-model="form.code" style="width: 370px;" />
                </el-form-item>
                <el-form-item label="名称" prop="name">
                    <el-input v-model="form.name" style="width: 370px;" />
                </el-form-item>
                <el-form-item label="仓库类型" prop="type">
                    <el-select v-model="form.type" filterable placeholder="请选择">
                    <el-option
                        v-for="item in dict.warehouse_type"
                        :key="item.id"
                        :label="item.label"
                        :value="item.value"
/>
                    </el-select>
                </el-form-item>
                <el-form-item label="备注">
                    <el-input v-model="form.remark" :rows="3" type="textarea" style="width: 370px;" />
                </el-form-item>
                <el-form-item label="可用状态">
                    <el-radio v-for="item in dict.data_status" :key="item.id" v-model="form.isEnable" :label="item.value">{{ item.label }}</el-radio>
                </el-form-item>
        </el-form>
</template>
<script>
import { form } from '@crud_my/crud'
const components = {}

export default {
  mixins: [form()],
  dicts: ['warehouse_type', 'data_status'],
  data() {
    return {
      form: this.crud.form,
      rules: {
        code: [
          { required: true, message: '编码不能为空', trigger: 'blur' }
        ],
        name: [
          { required: true, message: '名称不能为空', trigger: 'blur' }
        ],
        type: [
          { required: true, message: '仓库类型不能为空', trigger: 'blur' }
        ]
      }
    }
  }
}
</script>
